import {createRouter, createWebHistory} from 'vue-router'
import Layout from "@/layout/HomeLayout.vue";
import EquipmentLayout from "@/layout/EquipmentLayout.vue";
import NumberLayout from "@/layout/NumberLayout.vue";

const route=[
  {
    path: '/',
    name: 'home',
    component: Layout,
    redirect:'/home',
    children:[
      {
        path: '/home',
        name: '监控首页',
        component: () => import('../views/Home.vue')
      },
    ]
  },
  {
    path: '/equipment',
    name: '设备监管',
    component: EquipmentLayout,
    redirect: '/equipment/installedDevice',
    children: [
      {
        path: '/equipment/installedDevice',
        name: '已安装设备',
        component: () => import('../views/equipment/InstalledDevice.vue')
      },
      {
        path: '/equipment/deviceList',
        name: '设备列表',
        component: () => import('../views/equipment/DeviceList.vue')
      },
      {
        path: '/equipment/fireSystem',
        name: '传统火灾报警系统',
        component: () => import('../views/equipment/FireSystem.vue')
      },
      {
        path: '/equipment/site',
        name: '站点列表',
        component: () => import('../views/equipment/Site.vue')
      },
      {
        path: '/equipment/siteFloor',
        name: '楼层管理',
        component: () => import('../views/equipment/SiteFloor.vue')
      },
      {
        path: '/equipment/Contacts',
        name: '管理人信息',
        component: () => import('../views/equipment/Contacts.vue')
      },
      {
        path: '/equipment/deviceListDetail',
        name: '设备统计',
        component: () => import('../views/equipment/DeviceListDetail.vue')
      },
    ]
  },
  {
    path: '/number',
    name: '分级与用户',
    component: NumberLayout,
    redirect: '/number/number',
    children: [
      {
        path: '/number/number',
        name: '下级单位管理',
        component: () => import('../views/number/Number.vue')
      },
      {
        path: '/number/user',
        name: '用户管理',
        component: () => import('../views/number/User.vue')
      },
      {
        path: '/number/role',
        name: '角色管理',
        component: () => import('../views/number/Role.vue')
      },
    ]
  },
  {
    path: "/login",
    name: "login",
    component: () => import('../views/Login.vue')
  }

]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: route
})


export default router
